﻿$(document).ready(function() {
    function flipTile(deviceID) {
        $("#keypad" + deviceID).animate({ backgroundColor: "#FEF23C", color: "#000000" }, 1000);
    }
    window.setInterval(function() {
        $.ajax({
            type: 'POST',
            url: "/Respond/GetGridResponses",
            data: { pollID: $('#pollID').val() },
            datatype: "json",
            success: function(response) {
                for (var i = 0; i < response.length; i++) {
                    flipTile(response[i]);
                }
            }
        });
    }, 500);
});